package com.community.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import java.sql.Blob;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * <p>
 * AT transaction mode undo table
 * </p>
 *
 * @author 李晶
 * @since 2024-07-02
 */
@TableName("undo_log")
@ApiModel(value="UndoLog对象", description="AT transaction mode undo table")
public class UndoLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "branch transaction id")
    @TableId(value = "branch_id", type = IdType.AUTO)
    private Long branchId;

    @ApiModelProperty(value = "global transaction id")
    private String xid;

    @ApiModelProperty(value = "undo_log context,such as serialization")
    private String context;

    @ApiModelProperty(value = "rollback info")
    private Blob rollbackInfo;

    @ApiModelProperty(value = "0:normal status,1:defense status")
    private Integer logStatus;

    @ApiModelProperty(value = "create datetime")
    private LocalDateTime logCreated;

    @ApiModelProperty(value = "modify datetime")
    private LocalDateTime logModified;

    public Long getBranchId() {
        return branchId;
    }

    public void setBranchId(Long branchId) {
        this.branchId = branchId;
    }
    public String getXid() {
        return xid;
    }

    public void setXid(String xid) {
        this.xid = xid;
    }
    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }
    public Blob getRollbackInfo() {
        return rollbackInfo;
    }

    public void setRollbackInfo(Blob rollbackInfo) {
        this.rollbackInfo = rollbackInfo;
    }
    public Integer getLogStatus() {
        return logStatus;
    }

    public void setLogStatus(Integer logStatus) {
        this.logStatus = logStatus;
    }
    public LocalDateTime getLogCreated() {
        return logCreated;
    }

    public void setLogCreated(LocalDateTime logCreated) {
        this.logCreated = logCreated;
    }
    public LocalDateTime getLogModified() {
        return logModified;
    }

    public void setLogModified(LocalDateTime logModified) {
        this.logModified = logModified;
    }

    @Override
    public String toString() {
        return "UndoLog{" +
            "branchId=" + branchId +
            ", xid=" + xid +
            ", context=" + context +
            ", rollbackInfo=" + rollbackInfo +
            ", logStatus=" + logStatus +
            ", logCreated=" + logCreated +
            ", logModified=" + logModified +
        "}";
    }
}
